package example.demo.dp1;

import com.google.common.collect.Lists;

import java.util.Date;
import java.util.List;

public class Demo {
    public static void main(String[] args) {
        List<Parent> parentList = Lists.newArrayList(new StringImpl01(), new LocalDateTimeImpl03(), new DateImpl02());
        Object obj = "wahaha";
//        Object obj = new Date(System.currentTimeMillis()+2000);
        for (Parent parent : parentList) {
            if (parent.isSupport(obj)) {
                System.out.println(parent.getClass().getSimpleName()+"==="+parent.handle(obj));
            }
        }
    }
}
